import threading
from time import sleep
from typing import Optional, Callable, Any, Iterable, Mapping

from selenium import webdriver

path = 'g:\\PycharmProject\\chromedriver.exe'


def openwebdriver():
    url = 'http://www.baidu.com'
    driver = webdriver.Chrome(executable_path=path)
    driver.get(url)
    sleep(3)
    driver.close()


class mythread(threading.Thread):
    def __init__(self):
        threading.Thread.__init__(self)

    def run(self):
        openwebdriver()


def main():
    number=70
    thread1 = []
    for i in range(number):
        thread1.append(mythread())
    for i in range(number):
        thread1[i].start()
    for i in range(number):
        thread1[i].join()


if __name__ == '__main__':
    main()
